/**
 * Copyright(c) 2010 Ceno Techonologies Co., Ltd.
 *
 * History:
 *   15-6-5 上午11:21 Created by lyyang
 */
package com.jade.bss.business.coupon;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 * 卡券数据库类
 *
 * @author <a href="mailto:lyyang@ceno.cn">lyyang</a>
 * @version 1.0 15-6-5 上午11:13
 */
@Entity
@Table (name = "BSS_COUPON_BASE_INFO")
public class CouponInfo
        implements Serializable
{

    //卡券时间类型
    //固定日期区间
    public static final int TIME_TYPE_ONE = 1;
    //固定时间类型
    public static final int TIME_TYPE_TWO = 2;
    //卡券新建状态
    public static final int STATUS_CREATE = 1;
    //卡券审核中状态
    public static final int STATUS_AUDITING = 2;
    //卡券审核通过状态
    public static final int STATUS_AUDITED = 3;
    //卡券审核不通过状态
    public static final int STATUS_DENY = 4;
    //卡券发布状态
    public static final int STATUS_PUBLISH = 5;

    @Id
    @GeneratedValue (generator = "BSS_SEQ_COUPON_COUPON_BASE_INFO")
    @SequenceGenerator (name = "BSS_SEQ_COUPON_COUPON_BASE_INFO", sequenceName = "BSS_SEQ_COUPON_COUPON_BASE_INFO")
    private long id;

    @Column (name = "card_id")
    private String cardId;

    @Column (name = "owner_id")
    private String ownerId;

    @Column (name = "fid")
    private String fid;

    @Column (name = "owner_type")
    private String ownerType;

    @Column (name = "logo_url")
    private String logoUrl;

    @Column (name = "card_type")
    private String cardType;

    @Column (name = "code_type")
    private String codeType;

    @Column (name = "brand_nae")
    private String brandName;

    private String title;

    @Column (name = "sub_title")
    private String subTitle;

    private String color;

    private String notice;

    private String description;

    @Column (name = "date_type")
    private int dateType;

    @Column (name = "beginTime")
    private Date beginTime;

    @Column (name = "endTime")
    private Date endTime;

    @Column (name = "date_fixed_term")
    private int dateFixedTerm;

    @Column (name = "date_fixed_begin_term")
    private int dateFixedBeginTerm;

    private long quantity;

    @Transient
    private long[] shopIds;

    @Column (name = "use_custom_code")
    private boolean useCustomCode;

    //指定领用人id
    @Column (name = "bind_user_id")
    private boolean bindUserId;


    @Column (name = "can_share")
    private boolean canShare;

    @Column (name = "can_give_friend")
    private boolean canGiveFriend;

    @Column (name = "get_limit")
    private long getLimit;

    @Column (name = "service_phone")
    private String servicePhone;

    private String source;

    @Column (name = "custom_url_name")
    private String customUrlName;

    @Column (name = "custom_url")
    private String customUrl;

    @Column (name = "promotion_url_name")
    private String promotionUrlName;

    @Column (name = "promotion_url")
    private String promotionUrl;

    @Column (name = "custom_url_sub_name")
    private String customUrlSubName;

    @Column (name = "promotion_url_sub_name")
    private String promotionUrlSubName;

    //创建日期
    @Column (name = "create_date")
    private Date createDate;

    //发布日期
    @Column (name = "publish_date")
    private Date publishDate;

    private int status;

    private String detail;

    //折扣券,百分比30表示打7折
    private int discount;

    //礼品券
    private String gift;

    //代金券
    //起用金额单位分
    @Column (name = "least_cost")
    private long leastCost;
    //减免金额,单位分
    @Column (name = "reduce_cost")
    private long reduceCost;

    //景点门票
    //票类型
    @Column (name = "ticket_class")
    private String ticketClass;

    //导览图(会议,景点通用)
    @Column (name = "map_url")
    private String mapUrl;


//    @OneToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER,orphanRemoval = true)
//    @JoinColumn (name = "coupon_id")
//    private CouponExtInfo info;

    public String getCardId()
    {
        return cardId;
    }

    public void setCardId(String cardId)
    {
        this.cardId = cardId;
    }

//    public CouponExtInfo getInfo()
//    {
//        return info;
//    }
//
//    public void setInfo(CouponExtInfo info)
//    {
//        this.info = info;
//    }

    public long getId()
    {
        return id;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public String getOwnerId()
    {
        return ownerId;
    }

    public void setOwnerId(String ownerId)
    {
        this.ownerId = ownerId;
    }

    public String getOwnerType()
    {
        return ownerType;
    }

    public void setOwnerType(String ownerType)
    {
        this.ownerType = ownerType;
    }

    public String getFid()
    {
        return fid;
    }

    public void setFid(String fid)
    {
        this.fid = fid;
    }

    public String getLogoUrl()
    {
        return logoUrl;
    }

    public void setLogoUrl(String logoUrl)
    {
        this.logoUrl = logoUrl;
    }

    public String getCardType()
    {
        return cardType;
    }

    public void setCardType(String cardType)
    {
        this.cardType = cardType;
    }

    public String getCodeType()
    {
        return codeType;
    }

    public void setCodeType(String codeType)
    {
        this.codeType = codeType;
    }

    public String getBrandName()
    {
        return brandName;
    }

    public void setBrandName(String brandName)
    {
        this.brandName = brandName;
    }

    public String getTitle()
    {
        return title;
    }

    public void setTitle(String title)
    {
        this.title = title;
    }

    public String getSubTitle()
    {
        return subTitle;
    }

    public void setSubTitle(String subTitle)
    {
        this.subTitle = subTitle;
    }

    public String getColor()
    {
        return color;
    }

    public void setColor(String color)
    {
        this.color = color;
    }

    public String getNotice()
    {
        return notice;
    }

    public void setNotice(String notice)
    {
        this.notice = notice;
    }

    public String getDescription()
    {
        return description;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    public int getDateType()
    {
        return dateType;
    }

    public void setDateType(int dateType)
    {
        this.dateType = dateType;
    }

    public Date getBeginTime()
    {
        return beginTime;
    }

    public void setBeginTime(Date beginTime)
    {
        this.beginTime = beginTime;
    }

    public Date getEndTime()
    {
        return endTime;
    }

    public void setEndTime(Date endTime)
    {
        this.endTime = endTime;
    }

    public int getDateFixedTerm()
    {
        return dateFixedTerm;
    }

    public void setDateFixedTerm(int dateFixedTerm)
    {
        this.dateFixedTerm = dateFixedTerm;
    }

    public int getDateFixedBeginTerm()
    {
        return dateFixedBeginTerm;
    }

    public void setDateFixedBeginTerm(int dateFixedBeginTerm)
    {
        this.dateFixedBeginTerm = dateFixedBeginTerm;
    }

    public long getQuantity()
    {
        return quantity;
    }

    public void setQuantity(long quantity)
    {
        this.quantity = quantity;
    }

    public long[] getShopIds()
    {
        return shopIds;
    }

    public void setShopIds(long[] shopIds)
    {
        this.shopIds = shopIds;
    }


    public boolean isUseCustomCode()
    {
        return useCustomCode;
    }

    public void setUseCustomCode(boolean useCustomCode)
    {
        this.useCustomCode = useCustomCode;
    }

    public boolean isBindUserId()
    {
        return bindUserId;
    }

    public void setBindUserId(boolean bindUserId)
    {
        this.bindUserId = bindUserId;
    }

    public boolean isCanShare()
    {
        return canShare;
    }

    public void setCanShare(boolean canShare)
    {
        this.canShare = canShare;
    }

    public boolean isCanGiveFriend()
    {
        return canGiveFriend;
    }

    public void setCanGiveFriend(boolean canGiveFriend)
    {
        this.canGiveFriend = canGiveFriend;
    }

    public long getGetLimit()
    {
        return getLimit;
    }

    public void setGetLimit(long getLimit)
    {
        this.getLimit = getLimit;
    }

    public String getServicePhone()
    {
        return servicePhone;
    }

    public void setServicePhone(String servicePhone)
    {
        this.servicePhone = servicePhone;
    }

    public String getSource()
    {
        return source;
    }

    public void setSource(String source)
    {
        this.source = source;
    }

    public String getCustomUrlName()
    {
        return customUrlName;
    }

    public void setCustomUrlName(String customUrlName)
    {
        this.customUrlName = customUrlName;
    }

    public String getCustomUrl()
    {
        return customUrl;
    }

    public void setCustomUrl(String customUrl)
    {
        this.customUrl = customUrl;
    }

    public String getPromotionUrlName()
    {
        return promotionUrlName;
    }

    public void setPromotionUrlName(String promotionUrlName)
    {
        this.promotionUrlName = promotionUrlName;
    }

    public String getPromotionUrl()
    {
        return promotionUrl;
    }

    public void setPromotionUrl(String promotionUrl)
    {
        this.promotionUrl = promotionUrl;
    }

    public String getCustomUrlSubName()
    {
        return customUrlSubName;
    }

    public void setCustomUrlSubName(String customUrlSubName)
    {
        this.customUrlSubName = customUrlSubName;
    }

    public String getPromotionUrlSubName()
    {
        return promotionUrlSubName;
    }

    public void setPromotionUrlSubName(String promotionUrlSubName)
    {
        this.promotionUrlSubName = promotionUrlSubName;
    }

    public String getDetail()
    {
        return detail;
    }

    public void setDetail(String detail)
    {
        this.detail = detail;
    }

    public int getDiscount()
    {
        return discount;
    }

    public void setDiscount(int discount)
    {
        this.discount = discount;
    }

    public String getGift()
    {
        return gift;
    }

    public void setGift(String gift)
    {
        this.gift = gift;
    }

    public long getLeastCost()
    {
        return leastCost;
    }

    public void setLeastCost(long leastCost)
    {
        this.leastCost = leastCost;
    }

    public long getReduceCost()
    {
        return reduceCost;
    }

    public void setReduceCost(long reduceCost)
    {
        this.reduceCost = reduceCost;
    }

    public String getTicketClass()
    {
        return ticketClass;
    }

    public void setTicketClass(String ticketClass)
    {
        this.ticketClass = ticketClass;
    }

    public String getMapUrl()
    {
        return mapUrl;
    }

    public void setMapUrl(String mapUrl)
    {
        this.mapUrl = mapUrl;
    }

    public Date getCreateDate()
    {
        return createDate;
    }

    public void setCreateDate(Date createDate)
    {
        this.createDate = createDate;
    }

    public Date getPublishDate()
    {
        return publishDate;
    }

    public void setPublishDate(Date publishDate)
    {
        this.publishDate = publishDate;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(int status)
    {
        this.status = status;
    }

}
